package com.cas.webservice.model;

import java.util.ArrayList;
import java.util.List;

import com.cas.scalls.util.ObjectData;
import com.cas.scalls.util.TCPClient;

public class ThreadControl extends Thread{
	String ipaddr;
	int port;
	List<byte[]> data;
	List<ObjectData> listobjects;
	public ThreadControl(String ipaddr, int port, List<byte[]> data) {
		this.ipaddr = ipaddr;
		this.port = port;
		this.data = data;
		listobjects = new ArrayList<ObjectData>();
	}
	@Override
	public void run() { 
		try {
			ObjectData objrecive = new ObjectData(ipaddr);
			objrecive.listbyte = TCPClient.cmdForScale(ipaddr, port, data);
			listobjects.add(objrecive);
			successlist(listobjects,data);
		} catch (Exception e) {
		
		}
    } 
	//--TODO--------
	public static boolean successlist(List<ObjectData> listobject1,List<byte[]> data){
		for(int i = 0; i < listobject1.size(); i ++){
			if(listobject1.get(i).listbyte.get(0).equals("G")||listobject1.get(i).listbyte.get(0).equals("W")){
				
			}
		}
		return true;
	}
}
